0) { echo"\n$element"; } else { echo"\n\t\t$element"; } } //Finding Average $sum=array_sum($arr); if($sum > 0) { $cnt= count($arr); $avg= $sum / $cnt; echo"\nAverage= $avg"; } else{ echo"\nAverage cannot be counted"; } //Finding sum of elements $sum=array_sum($arr); echo"\nSum of elements in the array are: $sum"; ?>
0 Comments